package com.numkit.briefdraw.ui.property;

import java.awt.BasicStroke;

public class StrokeMaker {
	public static BasicStroke getStroke(int lineWidth, int stroke) {
		BasicStroke bs = null;
		switch (stroke) {
		case 0:
			bs = new BasicStroke(lineWidth);
			break;
		case 1:
			bs = new BasicStroke(lineWidth, BasicStroke.CAP_BUTT,
					BasicStroke.JOIN_MITER, 10.0f,
					new float[] { lineWidth * 2 }, 0.0f);
			break;
		case 2:
			bs = new BasicStroke(lineWidth, BasicStroke.CAP_ROUND,
					BasicStroke.JOIN_MITER, 10.0f,
					new float[] { lineWidth * 2 }, 0.0f);
			break;
		case 3:
			bs = new BasicStroke(lineWidth, BasicStroke.CAP_SQUARE,
					BasicStroke.JOIN_MITER, 10.0f,
					new float[] { lineWidth * 2 }, 0.0f);
			break;
		}
		return bs;
	}

	public static int getStrokeCount() {
		return 4;
	}
}
